let siFilter; // 时间筛选器定时器
let count = 0; // 计数 超次数据清除si
const ms = 500; // 定时器ms

function adjustTimerFilter() {
  const filterEl = document.querySelector('.m-dashbox-dateTimeFilter')
  if(filterEl) {
    // 1、监听时间筛选器
    document.addEventListener("click", function (event) {
      if (
        event.target.innerText.includes("前7天") ||
        event.target.innerText.includes("前14天") ||
        event.target.innerText.includes("前28天")
      ) {
        let ipt = event.target.querySelector("input");
        if (!ipt) {
          ipt = event.target.parentNode.querySelector("input");
        }
        if (ipt && ipt.checked) ipt.click();
      }
    });
    if (siFilter) {
      clearInterval(siFilter);
    }
  }
  if (count > (15 * 1000) / ms && si) {
    clearInterval(si);
  }
}

// 定时器调用时间筛选器
siFilter = setInterval(() => {
  adjustTimerFilter();
}, ms);

